home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UniversalModuleHeader.c
-
- Contains: Universal Module Header file
-
- Version: xxx put version here xxx
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #include <Types.h>
- #include <Devices.h>
- #include <DriverServices.h>
- #include <USB.h>
-
-
- #include "UniversalModule.h"
- #include "UniversalModuleVersion.h"
-
- static OSStatus UniversalModuleInitialize (USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
- static OSStatus UniversalModuleFinalize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc);
- static OSStatus UniversalInterfaceInitialize (UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
-
- extern usbUniversalPBStruct myUniversalPBRecord;
-
- //------------------------------------------------------
- //
- // This is the driver description structure that the expert looks for first.
- // If it's here, the information within is used to match the driver
- // to the device whose descriptor was passed to the expert.
- // Information in this block is also used by the expert when an
- // entry is created in the Name Registry.
- //
- //------------------------------------------------------
- USBDriverDescription TheUSBDriverDescription =
- {
- // Signature info
- kTheUSBDriverDescriptionSignature,
- kInitialUSBDriverDescriptor,
-
- // Device Info
- 0, // vendor = not device specific
- 0, // product = not device specific
- 0, // version of product = not device specific
- 0, // protocol = not device specific
-
- // Interface Info (* I don't think this would always be required...*)
- 0, // Configuration Value
- 0, // Interface Number
- kUSBHIDInterfaceClass, // Interface Class
- kUSBNoInterfaceSubClass, // Interface SubClass
- kUSBNoInterfaceProtocol, // Interface Protocol
-
-
- // Driver Info
- "\pUSBHIDUniversalModule", // Driver name for Name Registry
- kUSBHIDInterfaceClass, // Device Class (from USBDeviceDefines.h)
- kUSBCompositeSubClass, // Device Subclass
- kUniversalHexMajorVers,
- kUniversalHexMinorVers,
- kUniversalCurrentRelease,
- kUniversalReleaseStage, // version of driver
-
- // Driver Loading Info
- 0 // Flags (currently undefined)
- };
-
- USBClassDriverPluginDispatchTable TheClassDriverPluginDispatchTable =
- {
- kClassDriverPluginVersion, // Version of this structure
- 0, // Hardware Validation Procedure
- UniversalModuleInitialize, // Initialization Procedure
- UniversalInterfaceInitialize, // Interface Initialization Procedure
- UniversalModuleFinalize, // Finalization Procedure
- 0, // Driver Notification Procedure
- };
-
-
-
- // Initialization function
- // Called upon load by Expert
- static OSStatus UniversalModuleInitialize (USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable)
- {
- #pragma unused (busPowerAvailable)
- DriverEntry(device, pDesc);
- return (OSStatus)noErr;
- }
-
- // Interface Initialization Initialization function
- // Called upon load by Expert
- static OSStatus UniversalInterfaceInitialize (UInt32 interfaceNum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBInterfaceRef interfaceRef)
- {
- InterfaceEntry(interfaceNum, pInterface, pDesc, interfaceRef);
- return (OSStatus)noErr;
- }
-
-
-
- // Termination function
- // Called by Expert when driver is being shut down
- static OSStatus UniversalModuleFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc)
- {
- InterfaceExit(theDeviceRef, (USBInterfaceDescriptorPtr) pDesc); // we are only ever installed as an interface module
- return (OSStatus)noErr;
- }
-
-